
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

import uvicorn
from controller.Users import router as router_Users 
from controller.Blogs import router as router_Blogs
from controller.Comments import router as router_Comments
from controller.Collections import router as router_Collections
origins = ["*"]

app = FastAPI()
app.add_middleware(
    CORSMiddleware,
    allow_origins=origins,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)
app.include_router(router_Users)
app.include_router(router_Blogs)
app.include_router(router_Collections)
app.include_router(router_Comments)



if __name__ == "__main__":
    uvicorn.run("app:app",port=6677,reload=True,workers=2)


